package com.wr.pojos;

import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.util.List;

/**
 * 权限模型
 * 
 * @author StarZou
 * @since 2014年7月17日 下午1:02:55
 **/
@Alias("permission")
public class PermissionEntity implements Comparable<PermissionEntity>,Serializable{
    private int id;

    private String permissionName;

    private String permissionSign;

    private String description;

    private int isMenu;

    private int parentId;

    private String icon;

    private String sort;

    private String createTime;

    private String updateTime;

    private String operationId;

    private List<PermissionEntity> childList;

    private List<PermissionEntity> userChildList;

    private String userName;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getPermissionName() {
        return permissionName;
    }

    public void setPermissionName(String permissionName) {
        this.permissionName = permissionName == null ? null : permissionName.trim();
    }

    public String getPermissionSign() {
        return permissionSign;
    }

    public void setPermissionSign(String permissionSign) {
        this.permissionSign = permissionSign == null ? null : permissionSign.trim();
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description == null ? null : description.trim();
    }

    public int getIsMenu() {
        return isMenu;
    }

    public void setIsMenu(int isMenu) {
        this.isMenu = isMenu;
    }

    public int getParentId() {
        return parentId;
    }

    public void setParentId(int parentId) {
        this.parentId = parentId;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getOperationId() {
        return operationId;
    }

    public void setOperationId(String operationId) {
        this.operationId = operationId;
    }

    public List<PermissionEntity> getChildList() {
        return childList;
    }

    public void setChildList(List<PermissionEntity> childList) {
        this.childList = childList;
    }

    public List<PermissionEntity> getUserChildList() {
        return userChildList;
    }

    public void setUserChildList(List<PermissionEntity> userChildList) {
        this.userChildList = userChildList;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Override
    public int compareTo(PermissionEntity o) {
        if (sort != null && o.getSort() != null)
            return this.sort.compareTo(o.getSort());
        return 1;
    }
}